package org.example.entity;

import lombok.Data;

/**
 * @ClassName Result
 * @Description TODO
 * @Author qiuye
 * @Date 2025年08月20日 18:51
 * @Version 1.0
 */
@Data
public class Result {
    private int code;
    private String msg;
    private Integer newPoints; // 新增：返回新积分

    public static Result success(String msg, Integer newPoints) {
        Result result = new Result();
        result.setCode(200);
        result.setMsg(msg);
        result.setNewPoints(newPoints);
        return result;
    }

    public static Result success(String msg) {
        Result result = new Result();
        result.setCode(200);
        result.setMsg(msg);
        return result;
    }

    public static Result error(String msg) {
        Result result = new Result();
        result.setCode(500);
        result.setMsg(msg);
        return result;
    }
}
